package xpn.platform.modules.workflow.runtime.history;

import lombok.Getter;
import lombok.Setter;
import xpn.platform.common.persistence.AbstractBaseEntity;
import xpn.platform.modules.workflow.runtime.instance.Instance;
import xpn.platform.modules.workflow.runtime.todo.Todo;

import javax.persistence.*;
import javax.validation.constraints.NotNull;

/**
 * 操作者的操作记录
 *
 * @author bobatkm Sep 6, 2017
 */
@Entity
@Table(name = "wf_ru_history")
@Getter
@Setter
public class History extends AbstractBaseEntity {

	private static final long serialVersionUID = 6028822824882432990L;
	@ManyToOne
	@JoinColumn(nullable = false)
	@NotNull
	private Instance instance; // 所属流程实例

	@Column(nullable = true)
	private String executorId; // 执行者id

	@Column(nullable = false)
	private String executorName; // 执行者名称

	@JoinColumn(nullable = true)
	@ManyToOne
	private Todo executionTodo; // 执行时待办

	@Column(nullable = false)
	private String executionStateName;	//执行者所处状态名

	@Column(nullable = true)
	private Long actionId; // 操作Id

	@Column(nullable = false)
	private String actionName; // 操作名称

	@Column(nullable = true)
	private String sendeeId; // 接收者id

	@Column(nullable = true)
	private String sendeeName; // 接收者名称

	@JoinColumn(nullable = true)
	@ManyToOne
	private Todo sendeeTodo; // 接收者的待办
}
